﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using BLL;
using System.Data;

namespace UnqualifiedService
{
    /// <summary>
    /// Registration 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消注释以下行。 
    // [System.Web.Script.Services.ScriptService]
    public class Registration : System.Web.Services.WebService
    {
        private UserBLL ubll = new UserBLL();//登录
        private AuthorityBLL abll = new AuthorityBLL();//权限
        private RegistrateBLL rbll = new RegistrateBLL();//登记不良

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }

          #region 登录
        /// 测试
        [WebMethod]
        public string ceshi(string name, string password)
        {
            return "hello";
        }
        /// 登录判断姓名密码登录    
        [WebMethod]
        public bool GetUserInfoByName(string name, string password, out string id)           
        {
            //string id = "";
            id = "-1";

            return ubll.GetUserInfoByName(name, password, out id);
        }

        [WebMethod]
        //用户userid登录
        public bool GetUserInfoByUserID(string UserID, out string id, out string name)
        {   
            //string id = "";
            id = "-1";
            return ubll.GetUserInfoByUserID(UserID, out id,out  name);
        }
          #endregion


        #region 权限
        //判断权限
        [WebMethod]
       public string  GetPDAAuthority(string ID)
        {
            return abll.GetPDAAuthority(ID);
        }
        #endregion


        #region 制造F卡扫码
        //制造登记不良
        [WebMethod]
        public bool Registrate(string FCARD, float lf_Weight, string Reason, string CREATOR, string CREATETIME)
        {
            return rbll.Registrate(FCARD, lf_Weight, Reason,  CREATOR,  CREATETIME);
        }
        #endregion

        #region 技术重扫判定
        //技术更新NG状态
        [WebMethod]
        public bool UpdateStateNG(string FCARD ,string UPDATER,string UPDATETIME)
        {
            return rbll.UpdateStateNG(FCARD , UPDATER, UPDATETIME);
        }

        //技术更新OK状态
        [WebMethod]
        public bool UpdateStateOK(string FCARD, string UPDATER, string UPDATETIME)
        {
            return rbll.UpdateStateOK(FCARD , UPDATER, UPDATETIME);
        }

        //技术校验F卡，查询有没有F卡号
         [WebMethod]
        public bool GetFCARD(string FCARD)
        {
            return rbll.GetFCARD(FCARD);
        }

        //技术部获取待扫码的F卡
         [WebMethod]
         public DataSet GetFCARDList()
         {
             DataSet ld_return = new DataSet();
             ld_return = rbll.GetFCARDList();
             ld_return.Tables[0].TableName = "FCARD";
             return ld_return;
         }

        

        #endregion
    }
}
